package com.poker.wiki.job;

import com.poker.wiki.Service.DocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class DocJob {

    @Resource
    DocService docService;


    /**
     * 自定义cron表达式
     * 只有等上一次执行完成，下一次才会在下一个时间点执行，错过就错过
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void cron() throws InterruptedException {
        long stat = System.currentTimeMillis();
        docService.updateEbookInfo();

    }
}
